package com.gitee.dolt.sms.entity;

import lombok.AccessLevel;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.HashMap;
import java.util.Map;

/**
 * @author LYH
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class AliBatchSmsObj {
    private String phoneNumber;
    private String signName;
    private Map<String, String> templateParam;
    private String smsUpExtendCode;

    public AliBatchSmsObj putParam(String key, String value) {
        if (this.templateParam == null) {
            this.templateParam = new HashMap<>();
        }
        this.templateParam.put(key, value);
        return this;
    }

    public static AliBatchSmsObj newInstance(String phoneNumber) {
        return new AliBatchSmsObj().setPhoneNumber(phoneNumber);
    }
}
